package com.duowan.realtime.dao.impl;

import com.duowan.realtime.dao.BaseSpringJdbcDao;
import com.duowan.realtime.dao.RealtimeProductIverKpiDao;

import java.util.List;
import java.util.Map;

public class RealtimeProductIverKpiDaoImpl extends BaseSpringJdbcDao implements
		RealtimeProductIverKpiDao {

	@Override
	public void batchInsertToRealTimeProductIverKpi(List<Map<String, Object>> kvMapList) {
		String sql = "INSERT INTO realtime_product_iver_kpi(tdate,mtime,product,iver,kpi_code,kpi_value) " + "VALUES (:tdate,:mtime,:product,:iver,:kpiCode,:kpiValue) ON DUPLICATE KEY UPDATE kpi_value=values(kpi_value)";
		getNamedParameterJdbcTemplate().batchUpdate(sql, kvMapList.toArray(new Map[kvMapList.size()]));
	}

}
